function have(id) {
	return document.getElementById(id) ? true : false;
}



// 月度累计到款明细
function lineChartMD(id, seriesData, legendData, xData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		backgroundColor: "#fff",
		title: {
			text: "万元",
			left: "18px",
			top: "2",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		color: ["#165DFF", "#14C9C9", "#7239EA"],
		tooltip: {
			trigger: "axis",
			axisPointer: {
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
	border-radius: 6px;
	border:1px solid #FFFFFF ;
	box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
	background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
	background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
							<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}月</p>`;
				params.forEach(function (item) {
					result += `
							<div style="display: flex; flex-direction: row;justify-content: space-between;
							background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
								<div style="display: flex; flex-direction: row;align-items: center;">
									${item.marker}
									<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
								</div>
								<div class="">
									<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(item.value)}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
								</div>
							</div>
						`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "30",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: true,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: {
			name: "月",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			data: xData ? xData : ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
		},
		yAxis: {
			type: "value",
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

//瀑布图
function fallChart(id, option) {
	let chart = echarts.init(document.getElementById(id));

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function spaY(id, xData, legendData, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									  <p style="color: #1D2129;font-size: 12px;font-weight: 600;">${
                      params[0].name + "季度"
                    }</p>`;
				params.forEach(function (item) {
					result += `<div class="chartItemFormart">
										  <div style="display: flex; flex-direction: row;align-items: center;">
											  ${item.marker}
											  <p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										  </div>
										  <div class="">
											  <h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                          item.value
                        )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
										  </div>
									  </div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "0",
			bottom: "14",
			top: "60",
			containLabel: true,
		},

		legend: {
			data: legendData,
			show: true,
			x: "right",
			y: "top",
			width: 200,
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},

		xAxis: [{
			type: "category",
			data: xData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: true,
				lineStyle: {
					color: "#C9CDD4", // 坐标轴线线的颜色
					width: "1", // 坐标轴线线宽
					type: "solid", // 坐标轴线线的类型（'solid'，实线类型；'dashed'，虚线类型；'dotted',点状类型）
				},
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				interval: 0,
				lineHeight: "50",
			},
		}, ],
		yAxis: [{
			type: "value",
			name: "（%）",
			// min: 0,
			// max: 1000,
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		}, ],
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

//支出
function annulus1(id, totalrate, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		grid: {
			top: 0,
			left: 0,
			right: 0,
			containLabel: true,
		},
		legend: {
			orient: "vertical",
			top: "center",
			left: "25%",
			itemGap: 40,
			itemWidth: 4,
			itemHeight: 21,
			formatter: function (name) {
				let target;
				for (let i = 0, l = seriesData[0].data.length; i < l; i++) {
					if (seriesData[0].data[i].name == name) {
						target = seriesData[0].data[i].percent;
					}
				}
				name = name.length < 3 ? name + "   " : name;
				target = target.substr(0, target.length - 1);
				let arr = ["{a|" + name + "}{b|" + target + "} {c|%}"];
				return arr;
			},
			textStyle: {
				rich: {
					a: {
						fontSize: 14,
						verticalAlign: "top",
						align: "left",
						lineHeight: 14,
						padding: [3, 0, 0, 0],
						color: "#4E5969",
						width: 160,
					},
					b: {
						fontSize: 20,
						align: "right",
						padding: [0, 0, 0, 0],
						fontWeight: 600,
						color: "#1D2129",
					},
					c: {
						fontSize: 12,
						align: "right",
						padding: [0, 0, 0, 0],
						color: "#86909C",
					},
				},
			},
		},
		title: {
			text: "{b|" + totalrate + "}{c|%}\n{a|" + "执行率" + "}",
			x: "15%",
			y: "center",
			textAlign: "center",
			textStyle: {
				rich: {
					a: {
						fontSize: 12,
						color: "#4E5969",
						lineHeight: 24,
					},
					b: {
						fontSize: 36,
						color: "#1D2129",
						fontWeight: 600,
						lineHeight: 40,
					},
					c: {
						fontSize: 12,
						color: "#86909C",
					},
				},
			},
		},
		tooltip: {
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
				border-radius: 6px;
				border:1px solid #FFFFFF ;
				box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
				background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
				background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
				background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
				<div style="display: flex; flex-direction: row;justify-content: space-between;" >
											<div style="display: flex; flex-direction: row;align-items: center;">
												${params.marker}
												<p style="color: #4E5969;font-size: 12px;font-weight:600;">${params.name}</p>
											</div>
											<div class="">
												<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${params.data.percent}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
											</div>
										</div>
										</div>`;
				return result;
			},
		},
		series: seriesData,
	};
	option.series.push({
		itemStyle: {
			normal: {
				color: "#fff",
				shadowColor: "rgba(22, 93, 255, 0.12)",
				shadowBlur: 30,
			},
		},
		type: "pie",
		hoverAnimation: false,
		radius: ["68%", "87%"],
		center: ["15%", "50%"],
		label: {
			normal: {
				show: false,
			},
		},
		data: [{
			value: 1,
		}, ],
		z: -1,
	});
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function monthTrend(id, seriesData, legendData, xData, xDanwei, rotate) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		legend: {
			data: legendData,
			show: true,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: {
			name: xDanwei ? '' : "月",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			data: xData ? xData : ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				rotate: rotate > 0 ? rotate : 0,
				fontSize: 12,
				color: "#86909C",
			},
		},
		backgroundColor: "#fff",
		title: {
			text: "（万元）",
			left: "18px",
			top: "15",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:240px;padding: 8px;
		border-radius: 6px;
		border:1px solid #FFFFFF ;
		position: relative;
		z-index: 9999;
		box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
		background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
		background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
								<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}${xDanwei?'':'月'}</p>`;
				params.forEach(function (item) {
					result += `
								<div style="display: flex; flex-direction: row;justify-content: space-between;
								background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
									<div style="display: flex; flex-direction: row;align-items: center;">
										${item.marker}
										<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
									</div>
									<div class="">
										<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
									</div>
								</div>
							`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "5",
			bottom: "14",
			top: "50",
			containLabel: true,
		},
		yAxis: {
			type: "value",
			// max: '100',
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function balance(id, dataA, total) {
	let chart = echarts.init(document.getElementById(id));
	var dataA = dataA;
	var total = total;
	var color = "#165DFF";
	let option = {
		series: [{
				type: "gauge",
				splitNumber: 1,
				startAngle: 180,
				endAngle: 0,
				min: 0,
				max: total,
				radius: "60%",
				center: ["50%", "68%"],
				axisLine: {
					show: false,
				},
				//刻度标签。
				axisTick: {
					show: false,
				},
				//刻度样式
				splitLine: {
					show: false,
				},
				axisLabel: {
					distance: -90,
					formatter: function (value) {
						let string;
						if (value == 0) {
							string = dataA == 0 ? 0 : ((dataA / total).toFixed(2)) * 100
						} else {
							string = dataA == 0 ? 100 : (100 - (((dataA / total).toFixed(2)) * 100))
						}
						// if (value == 0) {
						//   string = total != 0 ? ((dataA / total) * 100).toFixed(2) : 0;
						// } else {
						//   string = ((1 - dataA / total) * 100).toFixed(2);
						// }
						let arr = ["{a|" + string + "}{b|%}"];
						return arr;
					},
					textStyle: {
						rich: {
							a: {
								fontSize: 20,
								verticalAlign: "top",
								align: "left",
								lineHeight: 14,
								padding: [60, 0, 0, 0],
								fontWeight: 600,
								color: "#1D2129",
							},
							b: {
								fontSize: 12,
								align: "left",
								padding: [65, 0, 0, 0],
								color: "#4E5969",
							},
						},
					},
				},
				//指针
				pointer: {
					width: 8,
					length: "55%",
				},
				//指针样式
				itemStyle: {
					color: "#0E42D2",
					borderWidth: 0,
					borderColor: "#ffffff",
					shadowColor: "rgba(14, 66, 210, .5)",
					shadowBlur: 6,
					shadowOffsetX: 0,
					shadowOffsetY: 5,
				},
				anchor: {
					show: true,
					showAbove: true,
					size: 15,
					itemStyle: {
						borderWidth: 3,
						color: "#0E42D2",
						borderColor: "#ffffff",
						itemStyle: {
							color: "#0E42D2",
							borderColor: "#ffffff",
						},
					},
				},
				title: {
					//标题
					show: false,
					offsetCenter: [0, 140], // x, y，单位px
					textStyle: {
						color: "#212b43",
						fontSize: 14, //表盘上的标题文字大小
						fontWeight: 400,
						lineHeight: 20,
					},
				},
				detail: {
					show: false,
					fontSize: 36,
					offsetCenter: [0, 90],
					valueAnimation: true,
					color: "#212b43",
					fontFamily: "Din",
					// formatter: function(value) {
					//     return value + '\n先锋指数'
					// }
				},
				data: [{
					value: dataA,
					name: "碳排放总资产\n(万吨)",
				}, ],
			},
			{
				type: "gauge",
				radius: "110%",
				center: ["50%", "68%"],
				startAngle: 180,
				endAngle: 0,
				min: 0,
				max: total,
				title: {
					show: false,
				},
				detail: {
					show: false,
				},
				axisLine: {
					show: true,
					// roundCap: true,
					lineStyle: {
						width: 45,
						color: [
							[dataA / total, color],
							[1, "#6AA1FF"],
						],
					},
				},
				axisTick: {
					show: false,
				},
				splitLine: {
					show: false,
				},
				axisLabel: {
					show: false,
				},
				pointer: {
					show: false,
				},
				itemStyle: {
					normal: {
						color: "#54F200",
					},
				},
			},
			{
				type: "gauge",
				splitNumber: 10,
				radius: "70%",
				center: ["50%", "68%"],
				min: 0,
				max: 100,
				startAngle: 180,
				endAngle: 0,
				pointer: {
					show: false,
					width: 7,
					length: "60%",
				},
				axisLine: {
					show: true,
					roundCap: true,
					lineStyle: {
						width: 5,
						color: [
							[dataA / total, color],
							[1, "#6AA1FF"],
						],
					},
				},
				axisLabel: {
					show: false,
				}, //刻度标签。
				axisTick: {
					show: false,
				}, //刻度样式
				splitLine: {
					show: false,
				}, //分隔线样式
				detail: {
					show: false,
				},
				title: {
					show: false,
				},
			},
		],
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function getYEstatisticsMonth(id, legendData, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		title: {
			text: "（万元）",
			left: "18px",
			top: "15",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		legend: {
			data: legendData,
			show: true,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: {
			name: "月",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
		},
		grid: {
			left: "0",
			right: "30",
			bottom: "14",
			top: "50",
			containLabel: true,
		},
		yAxis: {
			type: "value",

			// max: '100',
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:240px;padding: 8px;
		border-radius: 6px;
		border:1px solid #FFFFFF ;
		box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
		background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
		background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
								<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}月</p>`;
				params.forEach(function (item) {
					result += `
								<div style="display: flex; flex-direction: row;justify-content: space-between;
								background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
									<div style="display: flex; flex-direction: row;align-items: center;">
										${item.marker}
										<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
									</div>
									<div class="">
										<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
									</div>
								</div>
							`;
				});
				result += `</div>`;
				return result;
			},
		},
		series: seriesData,
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}


function getDirectDetail(id, legendData, seriesData, Xdata, xData1) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		title: {
			text: "（万元）",
			left: "18px",
			top: "15",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		legend: {
			data: legendData,
			show: true,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: [{

				type: "category",
				data: xData1,
				splitLine: {
					show: false,
				},
				axisTick: {
					show: false,

				},
				position: 'bottom',
				axisLine: {
					show: true,
					borderColor: '#C9CDD4'
				},
				axisLabel: {
					fontSize: 12,
					color: "#86909C",
				},
			},
			{

				type: "category",
				data: Xdata,
				splitLine: {
					show: false,
				},
				position: 'bottom',
				axisLine: {
					show: false,
				},
				axisLabel: {
					margin: 30,
					fontSize: 12,
					color: "#86909C",
					rotate:60
				},
				offset: 0,
				axisTick: {
					show: true,
					length: 50,
					lineStyle: {
						type: 'dotted',
						color: '#C9CDD4'
					}
				}
			}
		],
		grid: {
			left: "0",
			right: "0",
			bottom: "0",
			top: "50",
			containLabel: true,
		},
		yAxis: {
			type: "value",

			// max: '100',
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:240px;padding: 8px;
		border-radius: 6px;
		border:1px solid #FFFFFF ;
		box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
		background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
		background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
								<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `
								<div style="display: flex; flex-direction: row;justify-content: space-between;
								background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
									<div style="display: flex; flex-direction: row;align-items: center;">
										${item.marker}
										<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
									</div>
									<div class="">
										<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
									</div>
								</div>
							`;
				});
				result += `</div>`;
				return result;
			},
		},
		series: seriesData,
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function figure(data) {
	let str = "";
	let num = "";
	let newStr = "";
	data = data + "";
	if (data.indexOf(".") != -1) {
		num = data.split(".")[0];
		str = data.split(".")[1];
	} else {
		num = data;
	}
	newStr = num.toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
	newStr = str == "" ? newStr : newStr + "." + str;
	return newStr;
}

// 进度条
function progress_bar(id, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		grid: {
			top: 0,
			bottom: 0,
			left: 0,
			right: 0,
		},
		xAxis: {
			show: false,
			type: "value",
			boundaryGap: [0, 0],
		},
		yAxis: [{
			type: "category",
			data: [""],
			axisLine: {
				show: false,
			},
			axisTick: [{
				show: false,
			}, ],
		}, ],
		series: seriesData,
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

// 本年成本
function doughnut(id, title, color, data) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		legend: {
			show: false,
		},
		title: {
			text: title,
			x: "center",
			y: "center",
			textStyle: {
				fontSize: 12,
				color: "#4E5969",
			},
		},
		tooltip: {
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
				border-radius: 6px;
				border:1px solid #FFFFFF ;
				box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
				background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
				background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
				background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
				<div style="display: flex; flex-direction: row;justify-content: space-between;" >
											<div style="display: flex; flex-direction: row;align-items: center;">
												${params.marker}
												<p style="color: #4E5969;font-size: 12px;font-weight:600;">${params.name}</p>
											</div>
											<div class="">
												<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${params.percent}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
											</div>
										</div>
										</div>`;
				return result;
			},
		},
		series: [{
			name: "本年成本",
			type: "pie",
			radius: ["75%", "95%"],
			avoidLabelOverlap: true,
			itemStyle: {
				borderColor: "#fff",
				borderWidth: 2,
			},
			color: color,
			label: {
				show: false,
			},
			data: data,
		}, ],
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

// 月度预算执行情况
function lineChart(id, seriesData, legendData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		backgroundColor: "#fff",
		title: {
			text: "%",
			left: "18px",
			top: "15",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		color: ["#165DFF", "#00B2FF", "#86DF6C"],
		tooltip: {
			trigger: "axis",
			axisPointer: {
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
	border-radius: 6px;
	border:1px solid #FFFFFF ;
	box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
	background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
	background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
							<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}月</p>`;
				params.forEach(function (item) {
					result += `
							<div style="display: flex; flex-direction: row;justify-content: space-between;
							background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
								<div style="display: flex; flex-direction: row;align-items: center;">
									${item.marker}
									<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
								</div>
								<div class="">
									<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
								</div>
							</div>
						`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "30",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: true,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: {
			name: "月",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
		},
		yAxis: {
			type: "value",
			max: "100",
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

//成本预算执行情况
function horizontalBar(id, legendData, yAxisData, seriedData, unit = "%",posLeft) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},

			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `	<div class="chartItemFormart">
                                    <div style="display: flex; flex-direction: row;align-items: center;">
                                        ${item.marker}
                                        <p style="color: #4E5969;font-size: 12px;">${
                                          item.seriesName
                                        }</p>
                                    </div>
                                    <div class="">
                                        <h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                                          item.value
                                        )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">${unit}</span></h4>
                                    </div>
                                </div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: posLeft?posLeft:"80", //距离dom间距
			right: "50",
			top: "0",
			bottom: "20",
		},
		legend: {
			data: legendData,
			show: false,
			left: "120",
			top: "10",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		toolbox: {
			show: false,
		},
		xAxis: [{
			name:unit!==''?"(" + unit + ")":"",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
				
			},
			type: "value",
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		}, ],
		yAxis: [{
			type: "category",
			axisTick: {
				show: false,
			},
			data: yAxisData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 14,
				color: "#4E5969",
			},
		}, ],
		series: seriedData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

// 成本预算占比情况
function annulus(id, totalFigure, dw, rate, seriesData, titleX) {
	let chart = echarts.init(document.getElementById(id));
	let image;
	let imageColor;

	let option = {
		grid: {
			top: 0,
			left: 0,
			right: 0,
			containLabel: true,
		},
		legend: {
			orient: "vertical",
			top: "center",
			right: 0,
			itemGap: 35,
			itemWidth: 4,
			itemHeight: 21,
			formatter: function (name) {
				let target;
				for (let i = 0, l = seriesData[0].data.length; i < l; i++) {
					if (seriesData[0].data[i].name == name) {
						target = seriesData[0].data[i].percent;
					}
				}
				let arr = ["{a|" + name + "}{b|" + target + "} {c|%}"];
				return arr;
			},
			textStyle: {
				rich: {
					a: {
						fontSize: 14,
						verticalAlign: "top",
						align: "left",
						lineHeight: 14,
						padding: [3, 0, 0, 0],
						color: "#4E5969",
						width: 100,
					},
					b: {
						fontSize: 20,
						align: "left",
						padding: [0, 0, 0, 0],
						fontWeight: 600,
						color: "#1D2129",
					},
					c: {
						fontSize: 12,
						align: "bottom",
						padding: [0, 0, 0, 0],
						color: "#86909C",
					},
				},
			},
		},
		title: {
			text: "{a|" + "共计（" + dw + "）" + "}\n{b|" + totalFigure + "}",
			x: "23%",
			y: "center",
			width: 140,
			textAlign: "center",
			textStyle: {
				rich: {
					a: {
						fontSize: 12,
						color: "#86909C",
					},
					b: {
						fontSize: 24,
						color: "#1D2129",
						fontWeight: 600,
						lineHeight: 40,
					},
					icon: {
						height: 16,
						width: 16,
						backgroundColor: {
							image: image,
						},
					},
					c: {
						fontSize: 12,
						color: imageColor,
					},
					d: {
						fontSize: 12,
						color: "#86909C",
					},
				},
			},
		},
		tooltip: {
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartItemFormart">
                                <div style="display: flex; flex-direction: row;justify-content: space-between;" >
                                    <div style="display: flex; flex-direction: row;align-items: center;">
                                        ${params.marker}
                                        <p style="color: #4E5969;font-size: 12px;font-weight:600;">${params.seriesName}</p>
                                    </div>
                                    <div class="">
                                        <h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${params.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
                                    </div>
                                </div>
                            </div>`;
				return result;
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

// 柱状图
function verticalBar(id, xData, legendData, seriesData, unit = "%") {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `
									<div class="chartItemFormart">
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                        item.value
                      )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">${unit}</span></h4>
										</div>
									</div>
								`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "0",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: false,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: [{
			type: "category",
			data: xData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				interval: 0,
			},
		}, ],
		yAxis: [{
			type: "value",
			name: "(" + unit + ")",
			max: 100,
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		}, ],
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function ring(id, data) {
	let chart = echarts.init(document.getElementById(id));
	let colorList = ["#00B2FF", "#F2F3F5"];
	let option = {
		tooltip: {
			trigger: "item",
			show: false,
		},
		series: [{
			type: "pie",
			center: ["50%", "50%"],
			radius: ["60%", "76%"],
			clockwise: false,
			avoidLabelOverlap: false,
			hoverOffset: 0,
			itemStyle: {
				normal: {
					color: function (params) {
						return colorList[params.dataIndex];
					},
				},
			},
			label: {
				show: false,
			},
			labelLine: {
				show: false,
			},
			data: data,
		}, ],
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function fiveRateBar(id, data, xAxisData) {
	let chart = echarts.init(document.getElementById(id));
	let valueData = data;
	let option = {
		title: {
			text: "%",
			left: "18px",
			top: "15",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},

			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
			border-radius: 6px;
			border:1px solid #FFFFFF ;
			box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
			background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
			background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
			background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
			background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
			background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `
									<div style="display: flex; flex-direction: row;justify-content: space-between;
									background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
										</div>
									</div>
								`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "3%",
			right: "4%",
			bottom: "6%",
			containLabel: true,
		},
		xAxis: [{
			position: "bottom",
			type: "category",
			data: xAxisData,
			nameTextStyle: {
				textStyle: {
					color: "#86909C",
					fontSize: 10,
				},
			},
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
		}, ],
		yAxis: [{
			type: "value",
			position: "left",
			minInterval: 10,
			max: "100",
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		}, ],
		series: [{
			name: "执行",
			type: "bar",
			data: valueData,
			itemStyle: {
				normal: {
					color: "#165DFF",
				},
			},
			label: {
				normal: {
					formatter: "{a|{c}} {b|%}",
					show: true,
					position: "top",
					textStyle: {
						rich: {
							a: {
								fontSize: 16,
								color: "#1D2129",
								fontWeight: 600,
							},
							b: {
								fontSize: 12,
								color: "#86909C",
							},
						},
					},
				},
			},
			barMaxWidth: 24,
		}, ],
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function lineChart1(id, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		backgroundColor: "#fff",
		title: {
			text: "%",
			left: "18px",
			top: "0",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		color: ["#00B2FF"],
		tooltip: {
			trigger: "axis",
			axisPointer: {
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
	border-radius: 6px;
	border:1px solid #FFFFFF ;
	box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
	background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
	background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
							<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}月</p>`;
				params.forEach(function (item) {
					result += `
							<div style="display: flex; flex-direction: row;justify-content: space-between;
							background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
								<div style="display: flex; flex-direction: row;align-items: center;">
									${item.marker}
									<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
								</div>
								<div class="">
									<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
								</div>
							</div>
						`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "30",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: ["预算", "执行", "支出"],
			show: false,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: {
			name: "月",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
		},
		yAxis: {
			type: "value",
			max: "100",
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function lineChart2(id, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		backgroundColor: "#fff",
		title: {
			text: "（万元）",
			left: "18px",
			top: "15",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		color: ["#165DFF"],
		tooltip: {
			trigger: "axis",
			axisPointer: {
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
	border-radius: 6px;
	border:1px solid #FFFFFF ;
	box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
	background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
	background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
							<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}月</p>`;
				params.forEach(function (item) {
					result += `
							<div style="display: flex; flex-direction: row;justify-content: space-between;
							background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
								<div style="display: flex; flex-direction: row;align-items: center;">
									${item.marker}
									<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
								</div>
								<div class="">
									<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
								</div>
							</div>
						`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "30",
			bottom: "14",
			top: "50",
			containLabel: true,
		},
		legend: {
			data: ["到款"],
			show: false,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: {
			name: "月",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
		},
		yAxis: {
			type: "value",
			// max: '100',
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

// 多圆
function rings(id, max, data, color, series) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		title: {
			show: false,
		},
		angleAxis: {
			max: max, // 一圈是多少
			clockwise: true, // 逆时针
			show: false, // 隐藏刻度线
			startAngle: 90, // startAngle表示起始角度
			axisLine: {
				show: false, // 隐藏角度轴（圆心角）
			},
			axisTick: {
				show: false,
			},
			axisLabel: {
				show: false,
			},
			splitLine: {
				show: false, // 隐藏分割线
			},
		},

		radiusAxis: {
			type: "category",
			axisLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLabel: {
				show: false,
			},
			splitLine: {
				show: false,
			},
			z: 5,
		},
		polar: {
			center: ["20%", "50%"],
			radius: ["40%", "80%"], // 总体的最小半径、最大半径
		},
		tooltip: {
			show: true,
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			// formatter: function(e) {
			// 	return `${e.seriesName}<br/>${e.marker} ${e.value} `;
			// },
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
				border-radius: 6px;
				border:1px solid #FFFFFF ;
				box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
				background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
				background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
				background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
				<div style="display: flex; flex-direction: row;justify-content: space-between;" >
											<div style="display: flex; flex-direction: row;align-items: center;">
												${params.marker}
												<p style="color: #4E5969;font-size: 12px;font-weight:600;">${params.seriesName}</p>
											</div>
											<div class="">
												<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${params.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
											</div>
										</div>
										</div>`;
				return result;
			},
		},
		legend: {
			orient: "horizontal",
			data: data.map((v) => v.name),
			left: "35%",
			top: "30%",
			itemGap: 30,
			itemWidth: 4,
			itemHeight: 44,
			formatter: function (name) {
				var total = 0;
				var target;
				for (var i = 0, l = data.length; i < l; i++) {
					total += data[i].value;
					if (data[i].name == name) {
						target = data[i].value;
					}
				}
				var arr = ["{a|" + name + "}", "{b|" + target + "} {c|万元}"];
				return arr.join("\n");
			},
			textStyle: {
				rich: {
					a: {
						fontSize: 14,
						verticalAlign: "top",
						align: "left",
						padding: [0, 0, 8, 0],
						color: "#4E5969",
					},
					b: {
						fontSize: 20,
						align: "left",
						padding: [0, 0, 0, 0],
						fontWeight: 600,
						color: "#1D2129",
					},
					c: {
						fontSize: 12,
						align: "bottom",
						padding: [0, 0, 0, 0],
						color: "#86909C",
					},
				},
			},
		},
		series,
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

// 横向单行堆叠
function verticalStack(id, stackcolorList, stacklegendData, seriesList) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		color: stackcolorList,
		grid: {
			top: 0,
			left: 0,
			right: 0,
			containLabel: true,
		},
		legend: {
			top: "53%",
			left: 0,
			right: 0,
			itemGap: 40,
			itemWidth: 12,
			itemHeight: 12,
			data: stacklegendData,
			formatter: function (name) {
				let target;
				for (let i = 0, l = seriesList.length; i < l; i++) {
					if (seriesList[i].name == name) {
						target = seriesList[i].data[0].value;
					}
				}
				let arr = ["{a|" + name + "}", "{b|" + target + "} {c|万元}"];
				return arr.join("\n");
			},
			textStyle: {
				rich: {
					a: {
						fontSize: 14,
						verticalAlign: "top",
						align: "left",
						padding: [26, 0, 8, 0],
						color: "#4E5969",
					},
					b: {
						fontSize: 20,
						align: "left",
						padding: [0, 0, 0, 0],
						fontWeight: 600,
						color: "#1D2129",
					},
					c: {
						fontSize: 12,
						align: "bottom",
						padding: [0, 0, 0, 0],
						color: "#86909C",
					},
				},
			},
		},
		xAxis: [{
			type: "value",
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				show: false,
			},
			splitLine: {
				show: false,
			},
		}, ],
		yAxis: [{
			type: "category",
			data: [""],
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				show: false,
			},
		}, ],
		series: seriesList,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

// 多Y轴
function mulitYBar(id, xData, legendData, seriesData, unit = '', legendShow = true, percShow = true) {
	let chart = echarts.init(document.getElementById(id));
	chart.clear();
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}${unit}</p>`;
				params.forEach(function (item) {
					result += `<div class="chartItemFormart">
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                        item.value
                      )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">`;
					if (item.componentSubType == "line") {
						result += "%";
					} else {
						result += "万元";
					}
					result += `</span></h4>
										</div>
									</div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "10",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: legendShow,
			top: "-3",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: [{
			type: "category",
			data: xData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				interval: 0,
			},
		}, ],
		yAxis: [{
				type: "value",
				name: "（万元）",
				nameTextStyle: {
					color: "#86909C",
					fontSize: 10,
				},
				axisLabel: {
					fontSize: 12,
					color: "#86909C",
				},
				splitLine: {
					show: true,
					lineStyle: {
						color: "#E5E6EB",
						type: "dashed",
					},
				},
				axisLine: {
					show: false,
				},
			},
			{
				show: percShow,
				type: "value",
				name: "（%）",
				position: "right",
				alignTicks: true,
				axisLine: {
					lineStyle: {
						fontSize: 12,
						color: "#86909C",
					},
				},
				splitLine: {
					show: true,
					lineStyle: {
						color: "#E5E6EB",
						type: "dashed",
					},
				},
				axisLabel: {
					formatter: "{value}",
				},
			},
		],
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}


function mulitYBBar(id, xData, legendData, seriesData, unit = '', legendShow = true, percShow = true) {
	let chart = echartsBBar.init(document.getElementById(id));
	chart.clear()
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}${unit}</p>`;
				params.forEach(function (item) {
					result += `<div class="chartItemFormart">
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                        item.value
                      )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">`;
					if (item.componentSubType == "line") {
						result += "%";
					} else {
						result += "万元";
					}
					result += `</span></h4>
										</div>
									</div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "10",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: legendShow,
			top: "-3",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: [{
			type: "category",
			data: xData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				interval: 0,
			},
		}, ],
		yAxis: [{
				type: "value",
				name: "（万元）",
				nameTextStyle: {
					color: "#86909C",
					fontSize: 10,
				},
				axisLabel: {
					fontSize: 12,
					color: "#86909C",
				},
				splitLine: {
					show: true,
					lineStyle: {
						color: "#E5E6EB",
						type: "dashed",
					},
				},
				axisLine: {
					show: false,
				},
			},
			{
				show: percShow,
				type: "value",
				name: "（%）",
				position: "right",
				alignTicks: true,
				axisLine: {
					lineStyle: {
						fontSize: 12,
						color: "#86909C",
					},
				},
				splitLine: {
					show: true,
					lineStyle: {
						color: "#E5E6EB",
						type: "dashed",
					},
				},
				axisLabel: {
					formatter: "{value}",
				},
			},
		],
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}
//营业总成本构成
function totalOperatingCost(id, totalFigure, dw, rate, seriesData, titleX) {
	let chart = echarts.init(document.getElementById(id));
	let image;
	let imageColor;
	if (rate == 0) {
		image = "assets/images/home/icon-pingjun@2x.png";
		imageColor = "#165DFF";
	} else if (rate < 0) {
		image = "assets/images/home/arrow-down-filling.svg";
		imageColor = "#F53F3F";
	} else {
		image = "assets/images/home/arrow-up-filling.svg";
		imageColor = "#00B42A";
	}
	let option = {
		grid: {
			top: 0,
			left: 0,
			right: 0,
			containLabel: true,
		},
		legend: {
			orient: "vertical",
			top: "center",
			left: "55%",
			itemGap: 20,
			itemWidth: 4,
			itemHeight: 21,
			formatter: function (name) {
				let target;
				for (let i = 0, l = seriesData[0].data.length; i < l; i++) {
					if (seriesData[0].data[i].name == name) {
						target = seriesData[0].data[i].percent;
					}
				}
				target = target.substr(0, target.length - 1);
				let arr = ["{a|" + name + "}{b|" + target + "} {c|%}"];
				return arr;
			},
			textStyle: {
				rich: {
					a: {
						fontSize: 14,
						verticalAlign: "top",
						align: "left",
						lineHeight: 14,
						padding: [3, 0, 0, 0],
						color: "#4E5969",
						width: 140,
					},
					b: {
						fontSize: 20,
						align: "left",
						padding: [0, 0, 0, 0],
						fontWeight: 600,
						color: "#1D2129",
					},
					c: {
						fontSize: 12,
						align: "bottom",
						padding: [0, 0, 0, 0],
						color: "#86909C",
					},
				},
			},
		},
		title: {
			text: "{a|" +
				"共计（" +
				dw +
				"）" +
				"}\n{b|" +
				totalFigure +
				"}\n {icon|} {c|" +
				rate +
				"%}{d|" +
				"较上年" +
				"}",
			x: "25%",
			y: "center",
			width: 140,
			textAlign: "center",
			textStyle: {
				rich: {
					a: {
						fontSize: 12,
						color: "#86909C",
					},
					b: {
						fontSize: 24,
						color: "#1D2129",
						fontWeight: 600,
						lineHeight: 40,
					},
					icon: {
						height: 16,
						width: 16,
						backgroundColor: {
							image: image,
						},
					},
					c: {
						fontSize: 12,
						color: imageColor,
					},
					d: {
						fontSize: 12,
						color: "#86909C",
					},
				},
			},
		},
		tooltip: {
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
				border-radius: 6px;
				border:1px solid #FFFFFF ;
				box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
				background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
				background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
				background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
				<div style="display: flex; flex-direction: row;justify-content: space-between;" >
											<div style="display: flex; flex-direction: row;align-items: center;">
												${params.marker}
												<p style="color: #4E5969;font-size: 12px;font-weight:600;">${params.name}</p>
											</div>
											<div class="">
												<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${params.data.percent}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
											</div>
										</div>
										</div>`;
				return result;
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function costMonthLine(id, seriesData, legendData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		backgroundColor: "#fff",
		title: {
			text: "（万元）",
			left: "18px",
			top: "15",
			textStyle: {
				color: "#86909C",
				fontSize: 10,
				fontWeight: "400",
			},
		},
		color: ["#165DFF"],
		tooltip: {
			trigger: "axis",
			axisPointer: {
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
	border-radius: 6px;
	border:1px solid #FFFFFF ;
	box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
	background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
	background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
							<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}月</p>`;
				params.forEach(function (item) {
					result += `
							<div style="display: flex; flex-direction: row;justify-content: space-between;
							background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
								<div style="display: flex; flex-direction: row;align-items: center;">
									${item.marker}
									<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
								</div>
								<div class="">
									<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
								</div>
							</div>
						`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "30",
			bottom: "14",
			top: "50",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: true,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: {
			name: "月",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
		},
		yAxis: {
			type: "value",
			// max: '100',
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

//普通圆环
function normalPie(id, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		grid: {
			top: 0,
			left: 0,
			right: 0,
			containLabel: true,
		},
		color: ["#165DFF", "#846BCE", "#86DF6C"],
		legend: {
			orient: "vertical",
			top: "bottom",
			left: "45%",
			itemGap: 15,
			itemWidth: 4,
			itemHeight: 20,
			formatter: function (name) {
				let target;
				for (let i = 0, l = seriesData[0].data.length; i < l; i++) {
					if (seriesData[0].data[i].name == name) {
						target = seriesData[0].data[i].percent;
					}
				}
				target = target.substr(0, target.length - 1);
				let arr = ["{a|" + name + "}{b|" + target + "} {c|%}"];
				return arr;
			},
			textStyle: {
				rich: {
					a: {
						fontSize: 14,
						verticalAlign: "top",
						align: "left",
						lineHeight: 14,
						padding: [3, 0, 0, 0],
						color: "#4E5969",
						width: 140,
					},
					b: {
						fontSize: 20,
						align: "left",
						padding: [0, 0, 0, 0],
						fontWeight: 600,
						color: "#1D2129",
					},
					c: {
						fontSize: 12,
						align: "bottom",
						padding: [0, 0, 0, 0],
						color: "#86909C",
					},
				},
			},
		},
		series: seriesData,
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

//现金流程-同期趋势对比
function CashflowLineChart(id, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		backgroundColor: "#fff",
		title: {
			text: "同期趋势对比",
			top: -5,
			textStyle: {
				color: "#1D2129",
				fontSize: 14,
				fontWeight: "400",
			},
		},
		color: ["#00B2FF"],
		tooltip: {
			trigger: "axis",
			axisPointer: {
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
	border-radius: 6px;
	border:1px solid #FFFFFF ;
	box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
	background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
	background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
							<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}月</p>`;
				params.forEach(function (item) {
					result += `
							<div style="display: flex; flex-direction: row;justify-content: space-between;
							background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
								<div style="display: flex; flex-direction: row;align-items: center;">
									${item.marker}
									<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
								</div>
								<div class="">
									<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
								</div>
							</div>
						`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "30",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: ["预算", "执行", "支出"],
			show: false,
			right: "0",
			top: "0",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: {
			name: "月",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
		},
		yAxis: {
			type: "value",
			max: "100",
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});

	$("div").resize(function () {
		chart.resize();
	});
}

//现金流量tab标签
function cashflowListChart(id, prevYearData, CurryearData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		color: ["#165DFF", "#00B2FF"],
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
			border-radius: 6px;
			border:1px solid #FFFFFF ;
			box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
			background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
			background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
			background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
			background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
			background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
			background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `
									<div style="display: flex; flex-direction: row;justify-content: space-between;
									background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                        item.value
                      )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
										</div>
									</div>
								`;
				});
				result += `</div>`;
				return result;
			},
		},
		legend: {
			data: ["本年", "上年"],
			show: true,
			right: "10",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		grid: {
			left: "0",
			right: "0",
			bottom: "3%",
			containLabel: false,
		},
		xAxis: [{
			type: "category",
			data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
			boundaryGap: false,
			show: false,
		}, ],
		yAxis: [{
			show: false,
		}, ],
		series: [{
				name: "本年",
				type: "line",
				stack: "Total",
				smooth: true,
				lineStyle: {
					width: 1,
				},
				showSymbol: false,
				areaStyle: {
					opacity: 0.3,
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
							offset: 0,
							color: "rgb(232, 243, 255)",
						},
						{
							offset: 1,
							color: "#E8F3FF",
						},
					]),
				},
				emphasis: {
					focus: "series",
				},
				data: CurryearData,
			},
			{
				name: "上年",
				type: "line",
				stack: "Total",
				smooth: true,
				lineStyle: {
					width: 1,
				},
				showSymbol: false,
				areaStyle: {
					opacity: 0.3,
					color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
							offset: 0,
							color: "rgb(232, 243, 255)",
						},
						{
							offset: 1,
							color: "#E8F3FF",
						},
					]),
				},
				emphasis: {
					focus: "series",
				},
				data: prevYearData,
			},
		],
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		var chart2div = document.getElementById(id);
		var tabcontent = document.getElementById("chartlist");
		width = tabcontent.offsetWidth;
		height = tabcontent.offsetHeight;
		chart2div.style.width = width + "px";
		chart2div.style.height = height + "px";
		chart.resize(width, height);
	});
	$("div").resize(function () {
		chart.resize();
	});
}

//单y轴
function oneYBar(id, xData, legendData, seriesData,unit='万元') {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${
                    params[0].name + "季度"
                  }</p>`;
				params.forEach(function (item) {
					result += `<div class="chartItemFormart">
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                        item.value
                      )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">`;
					if (item.componentSubType == "line") {
						result += "";
					} else {
						result += unit;
					}
					result += `</span></h4>
										</div>
									</div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "0",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		// legend: {
		//     data: legendData,
		//     show: true,
		//     top: '-3',
		//     icon: 'circle',
		//     textStyle: {
		//         color: '#1D2129',
		//         fontSize: '12'
		//     },
		//     itemWidth: 12,
		//     itemHeight: 12,
		// },
		xAxis: [{
			type: "category",
			data: xData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				interval: 0,
			},
		}, ],
		yAxis: [{
			type: "value",
			name: "（"+unit+"）",
			// min: 0,
			// max: 1000,
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		}, ],
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}
//单y轴 + legend
function oneYBarlegend(id, xData, legendData, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${
                    params[0].name + "季度"
                  }</p>`;
				params.forEach(function (item) {
					result += `<div class="chartItemFormart">
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                        item.value
                      )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">`;
					if (item.componentSubType == "line") {
						result += "";
					} else {
						result += "万元";
					}
					result += `</span></h4>
										</div>
									</div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "0",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: true,
			top: "-3",
			right: "-3",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: [{
			type: "category",
			data: xData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				interval: 0,
			},
		}, ],
		yAxis: [{
			type: "value",
			name: "（万元）",
			// min: 0,
			// max: 1000,
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		}, ],
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

//  y轴 (...)
function YhorizontalBar(id, legendData, yAxisData, seriedData, unit = "%") {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},

			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `	<div class="chartItemFormart">
                                    <div style="display: flex; flex-direction: row;align-items: center;">
                                        ${item.marker}
                                        <p style="color: #4E5969;font-size: 12px;">${
                                          item.seriesName
                                        }</p>
                                    </div>
                                    <div class="">
                                        <h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                                          item.value
                                        )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">${unit}</span></h4>
                                    </div>
                                </div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "80", //距离dom间距
			right: "50",
			top: "0",
			bottom: "20",
		},
		legend: {
			data: legendData,
			show: false,
			left: "120",
			top: "10",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		toolbox: {
			show: false,
		},
		xAxis: [{
			name: "(" + unit + ")",
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "value",
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		}, ],
		yAxis: [{
			type: "category",
			triggerEvent: true,
			axisTick: {
				show: false,
			},
			data: yAxisData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 14,
				color: "#4E5969",
				formatter: function (value) {
					var texts = value;
					if (texts.length > 8) {
						texts = texts.substr(0, 8) + "...";
					}
					return texts;
				},
			},
		}, ],
		series: seriedData,
	};
	chart.setOption(option);
	extension(chart);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}
//鼠标hover展示全部
function extension(chart) {
	//判断是否创建过div框,如果创建过就不再创建了
	var id = document.getElementById("extension");

	if (!id) {
		var div = "<div id = 'extension' sytle=\"display:none\"></div>";
		$("html").append(div);
	}

	chart.on("mouseover", function (params) {
		if (params.componentType == "yAxis") {
			$("#extension")
				.css({
					position: "absolute",
					color: "#ffffff",
					//"border":"solid 2px white",
					"font-family": "Arial",
					"font-size": "12px",
					padding: "3px",
					display: "inline",
					background: "#666666",
				})
				.text(params.value);

			$("html").mousemove(function (event) {
				var xx = event.pageX - 30;
				var yy = event.pageY + 20;
				$("#extension").css("top", yy).css("left", xx);
			});
		}
	});

	chart.on("mouseout", function (params) {
		if (params.componentType == "yAxis") {
			$("#extension").css("display", "none");
		}
	});
}

function zcbalance(id, dataA, total) {
	let chart = echarts.init(document.getElementById(id));
	var dataA = dataA;
	var total = total;
	var color = "#165DFF";
	let option = {
		series: [{
				type: "gauge",
				splitNumber: 1,
				startAngle: 180,
				endAngle: 0,
				min: 0,
				max: total,
				radius: "60%",
				center: ["50%", "68%"],
				axisLine: {
					show: false,
				},
				//刻度标签。
				axisTick: {
					show: false,
				},
				//刻度样式
				splitLine: {
					show: false,
				},
				axisLabel: {
					distance: -90,
					formatter: function (value) {
						let string;
						if (value == 0) {
							string = dataA == 0 ? 0 : ((dataA / total).toFixed(2)) * 100
						} else {
							string = dataA == 0 ? 100 : (100 - (((dataA / total).toFixed(2)) * 100))
						}
						let arr = ["{a|" + string + "}{b|%}"];
						return arr;
					},
					textStyle: {
						rich: {
							a: {
								fontSize: 20,
								verticalAlign: "top",
								align: "left",
								lineHeight: 14,
								padding: [60, 0, 0, 0],
								fontWeight: 600,
								color: "#1D2129",
							},
							b: {
								fontSize: 12,
								align: "left",
								padding: [65, 0, 0, 0],
								color: "#4E5969",
							},
						},
					},
				},
				//指针
				pointer: {
					width: 8,
					length: "55%",
				},
				//指针样式
				itemStyle: {
					color: "#0E42D2",
					borderWidth: 0,
					borderColor: "#ffffff",
					shadowColor: "rgba(14, 66, 210, .5)",
					shadowBlur: 6,
					shadowOffsetX: 0,
					shadowOffsetY: 5,
				},
				anchor: {
					show: true,
					showAbove: true,
					size: 15,
					itemStyle: {
						borderWidth: 3,
						color: "#0E42D2",
						borderColor: "#ffffff",
						itemStyle: {
							color: "#0E42D2",
							borderColor: "#ffffff",
						},
					},
				},
				title: {
					//标题
					show: false,
					offsetCenter: [0, 140], // x, y，单位px
					textStyle: {
						color: "#212b43",
						fontSize: 14, //表盘上的标题文字大小
						fontWeight: 400,
						lineHeight: 20,
					},
				},
				detail: {
					show: false,
					fontSize: 36,
					offsetCenter: [0, 90],
					valueAnimation: true,
					color: "#212b43",
					fontFamily: "Din",
				},
				data: [{
					value: dataA,
					name: "碳排放总资产\n(万吨)",
				}, ],
			},
			{
				type: "gauge",
				radius: "120%",
				center: ["50%", "70%"],
				startAngle: 180,
				endAngle: 0,
				min: 0,
				max: total,
				title: {
					show: false,
				},
				detail: {
					show: false,
				},
				axisLine: {
					show: true,
					// roundCap: true,
					lineStyle: {
						width: 45,
						color: [
							[dataA / total, color],
							[1, "#6AA1FF"],
						],
					},
				},
				axisTick: {
					show: false,
				},
				splitLine: {
					show: false,
				},
				axisLabel: {
					show: false,
				},
				pointer: {
					show: false,
				},
				itemStyle: {
					normal: {
						color: "#54F200",
					},
				},
			},
			{
				type: "gauge",
				splitNumber: 10,
				radius: "70%",
				center: ["50%", "68%"],
				min: 0,
				max: 100,
				startAngle: 180,
				endAngle: 0,
				pointer: {
					show: false,
					width: 7,
					length: "60%",
				},
				axisLine: {
					show: true,
					roundCap: true,
					lineStyle: {
						width: 5,
						color: [
							[dataA / total, color],
							[1, "#6AA1FF"],
						],
					},
				},
				axisLabel: {
					show: false,
				}, //刻度标签。
				axisTick: {
					show: false,
				}, //刻度样式
				splitLine: {
					show: false,
				}, //分隔线样式
				detail: {
					show: false,
				},
				title: {
					show: false,
				},
			},
		],
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function fzbalance(id, dataA, total) {
	let chart = echarts.init(document.getElementById(id));
	var dataA = dataA;
	var total = total;
	var color = "#CF2F65";
	let option = {
		series: [{
				type: "gauge",
				splitNumber: 1,
				startAngle: 180,
				endAngle: 0,
				min: 0,
				max: total,
				radius: "60%",
				center: ["50%", "68%"],
				axisLine: {
					show: false,
				},
				//刻度标签。
				axisTick: {
					show: false,
				},
				//刻度样式
				splitLine: {
					show: false,
				},
				axisLabel: {
					distance: -90,
					formatter: function (value) {
						let string;
						if (value == 0) {
							string = dataA == 0 ? 0 : ((dataA / total).toFixed(2)) * 100
						} else {
							string = dataA == 0 ? 100 : (100 - (((dataA / total).toFixed(2)) * 100))
						}
						let arr = ["{a|" + string + "}{b|%}"];
						return arr;
					},
					textStyle: {
						rich: {
							a: {
								fontSize: 20,
								verticalAlign: "top",
								align: "left",
								lineHeight: 14,
								padding: [60, 0, 0, 0],
								fontWeight: 600,
								color: "#1D2129",
							},
							b: {
								fontSize: 12,
								align: "left",
								padding: [65, 0, 0, 0],
								color: "#4E5969",
							},
						},
					},
				},
				//指针
				pointer: {
					width: 8,
					length: "55%",
				},
				//指针样式
				itemStyle: {
					color: "#A62651",
					borderWidth: 0,
					borderColor: "#ffffff",
					shadowColor: "rgba(14, 66, 210, .5)",
					shadowBlur: 6,
					shadowOffsetX: 0,
					shadowOffsetY: 5,
				},
				anchor: {
					show: true,
					showAbove: true,
					size: 15,
					itemStyle: {
						borderWidth: 3,
						color: "#A62651",
						borderColor: "#ffffff",
						itemStyle: {
							color: "#CF2F65",
							borderColor: "#ffffff",
						},
					},
				},
				title: {
					//标题
					show: false,
					offsetCenter: [0, 140], // x, y，单位px
					textStyle: {
						color: "#212b43",
						fontSize: 14, //表盘上的标题文字大小
						fontWeight: 400,
						lineHeight: 20,
					},
				},
				detail: {
					show: false,
					fontSize: 36,
					offsetCenter: [0, 90],
					valueAnimation: true,
					color: "#212b43",
					fontFamily: "Din",
				},
				data: [{
					value: dataA,
					name: "碳排放总资产\n(万吨)",
				}, ],
			},
			{
				type: "gauge",
				radius: "120%",
				center: ["50%", "70%"],
				startAngle: 180,
				endAngle: 0,
				min: 0,
				max: total,
				title: {
					show: false,
				},
				detail: {
					show: false,
				},
				axisLine: {
					show: true,
					// roundCap: true,
					lineStyle: {
						width: 45,
						color: [
							[dataA / total, color],
							[1, "#F66F83"],
						],
					},
				},
				axisTick: {
					show: false,
				},
				splitLine: {
					show: false,
				},
				axisLabel: {
					show: false,
				},
				pointer: {
					show: false,
				},
				itemStyle: {
					normal: {
						color: "#54F200",
					},
				},
			},
			{
				type: "gauge",
				splitNumber: 10,
				radius: "70%",
				center: ["50%", "68%"],
				min: 0,
				max: 100,
				startAngle: 180,
				endAngle: 0,
				pointer: {
					show: false,
					width: 7,
					length: "60%",
				},
				axisLine: {
					show: true,
					roundCap: true,
					lineStyle: {
						width: 5,
						color: [
							[dataA / total, color],
							[1, "#F66F83"],
						],
					},
				},
				axisLabel: {
					show: false,
				}, //刻度标签。
				axisTick: {
					show: false,
				}, //刻度样式
				splitLine: {
					show: false,
				}, //分隔线样式
				detail: {
					show: false,
				},
				title: {
					show: false,
				},
			},
		],
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

// 各类型到款占比
function Proportion(id, totalFigure, dw, rate, seriesData, titleX) {
	let chart = echarts.init(document.getElementById(id));
	let image;
	let imageColor;

	let option = {
		grid: {
			top: 0,
			left: 0,
			right: 0,
			containLabel: true,
		},
		legend: {
			orient: "vertical",
			top: "center",
			right: 0,
			itemGap: 35,
			itemWidth: 4,
			itemHeight: 21,
			formatter: function (name) {
				let target;
				for (let i = 0, l = seriesData[0].data.length; i < l; i++) {
					if (seriesData[0].data[i].name == name) {
						target = seriesData[0].data[i].percent;
					}
				}
				let arr = ["{a|" + name + "}{b|" + target + "} {c|%}"];
				return arr;
			},
			textStyle: {
				rich: {
					a: {
						fontSize: 14,
						verticalAlign: "top",
						align: "left",
						lineHeight: 14,
						padding: [3, 0, 0, 0],
						color: "#4E5969",
						width: 100,
					},
					b: {
						fontSize: 20,
						align: "left",
						padding: [0, 0, 0, 0],
						fontWeight: 600,
						color: "#1D2129",
					},
					c: {
						fontSize: 12,
						align: "bottom",
						padding: [0, 0, 0, 0],
						color: "#86909C",
					},
				},
			},
		},
		title: {
			text: "{a|" + "共计（" + dw + "）" + "}\n{b|" + totalFigure + "}",
			x: "28%",
			y: "center",
			width: 140,
			textAlign: "center",
			textStyle: {
				rich: {
					a: {
						fontSize: 12,
						color: "#86909C",
					},
					b: {
						fontSize: 24,
						color: "#1D2129",
						fontWeight: 600,
						lineHeight: 40,
					},
					icon: {
						height: 16,
						width: 16,
						backgroundColor: {
							image: image,
						},
					},
					c: {
						fontSize: 12,
						color: imageColor,
					},
					d: {
						fontSize: 12,
						color: "#86909C",
					},
				},
			},
		},
		tooltip: {
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartItemFormart">
                                <div style="display: flex; flex-direction: row;justify-content: space-between;" >
                                    <div style="display: flex; flex-direction: row;align-items: center;">
                                        ${params.marker}
                                        <p style="color: #4E5969;font-size: 12px;font-weight:600;">${params.seriesName}</p>
                                    </div>
                                    <div class="">
                                        <h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${params.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
                                    </div>
                                </div>
                            </div>`;
				return result;
			},
		},
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}
//月度趋势
function yueduqushi(id, xData, legendData, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `<div class="chartItemFormart">
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                        item.value
                      )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">`;
					if (item.componentSubType == "line") {
						result += "";
					} else {
						result += "万元";
					}
					result += `</span></h4>
										</div>
									</div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "0",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: true,
			top: "-3",
			right: "-3",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: [{
			type: "category",
			data: xData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				interval: 0,
			},
		}, ],
		yAxis: [{
			type: "value",
			name: "万元",
			// min: 0,
			// max: 1000,
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		}, ],
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}


// 部门收支 全所支出组成情况
function quansuozhichuPie(id, color, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "item",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:180px;padding: 8px;
				border-radius: 6px;
				border:1px solid #FFFFFF ;
				box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
				background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
				background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
				background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
				<div style="display: flex; flex-direction: row;justify-content: space-between;" >
											<div style="display: flex; flex-direction: row;align-items: center;">
												${params.marker}
												<p style="color: #4E5969;font-size: 12px;font-weight:600;">${params.name}</p>
											</div>
											<div class="">
												<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${params.percent}<span style="font-weight: normal;color: #86909C;font-size: 12px;">%</span></h4>
											</div>
										</div>
										</div>`;
				return result;
			},
		},
		legend: {
			show: false
		},
		series: [{
			type: 'pie',
			radius: '95%',
			center: ['50%', '50%'],
			label: {
				show: false
			},
			labelLine: {
				length: 10,
				length2: 60,
			},
			itemStyle: {
				normal: {
					borderColor: '#fff',
					borderWidth: 2,
					color: function (params) {
						return color[params.dataIndex];
					},
				},
			},
			data: seriesData,
		}, ],
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function leijizhichuBar(id, ylabel, seriesData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:240px;padding: 8px;
				border-radius: 6px;
				border:1px solid #FFFFFF ;
				position: relative;
				z-index: 9999;
				box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
				background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
				background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
				background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
				background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
										<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `
										<div style="display: flex; flex-direction: row;justify-content: space-between;
										background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
											<div style="display: flex; flex-direction: row;align-items: center;">
												${item.marker}
												<p style="color: #4E5969;font-size: 12px;">累计支出</p>
											</div>
											<div class="">
												<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
											</div>
										</div>
									`;
				});
				result += `</div>`;
				return result;
			},
		},
		color: '#165DFF',
		grid: {
			left: '5%',
			right: '14%',
			bottom: '5%',
			top: '3%',
			containLabel: true,
		},
		backgroundColor: '#fff',
		xAxis: {
			name: "（万元）",
			type: "value",
			// max: '100',
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
			axisLine: {
				show: false,
			},
		},
		yAxis: [{
			type: 'category',
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			type: "category",
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			data: ylabel,
		}, ],
		series: [{
			name: '数据',
			type: 'bar',
			zlevel: 1,
			barWidth: 15,
			data: seriesData,
		}, ],
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}


//部门间接费用情况
function getYstackedColumn(id, xData, legendData, seriesData) {
	let chart = echarts.init(document.getElementById(id));

	var option = {
		legend: {
			top: "-3",
			right: "-3",
			itemWidth: 12,
			itemHeight: 12,
			icon: "circle",
			textStyle: {
				fontSize: 12,
				color: '#1D2129',
			},
			data: legendData,
		},
		grid: {
			left: '4%',
			right: '4%',
			bottom: '2%',
			top: '8%',
			containLabel: true,
		},
		xAxis: {
			type: 'category',
			axisLabel: {
				color: '#86909C',
				rotate: 30, //倾斜度
			},
			axisLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			data: xData,
		},
		yAxis: {
			name: '万元',
			type: 'value',
			nameTextStyle: {
				color: "#86909C",
				fontSize: 10,
			},
			left: "0%",
			axisLabel: {
				fontSize: 12,
				color: '#86909C',
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
			},
			splitLine: {
				show: true,
				lineStyle: {
					color: "#E5E6EB",
					type: "dashed",
				},
			},
		},
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:240px;padding: 8px;
		border-radius: 6px;
		border:1px solid #FFFFFF ;
		box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
		background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
		background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
								<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result += `
								<div style="display: flex; flex-direction: row;justify-content: space-between;
								background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
									<div style="display: flex; flex-direction: row;align-items: center;">
										${item.marker}
										<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
									</div>
									<div class="">
										<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
									</div>
								</div>
							`;
				});
				result += `</div>`;
				return result;
			},
		},
		series: seriesData,
	};

	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}
//来款统计(2022-)
function BiaxialGraphPreStackingLines(id, legendData, Xdata, seriedData) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		legend: {
			top: "0",
			itemWidth: 12,
			itemHeight: 12,
			icon: "circle",
			textStyle: {
				fontSize: 12,
				color: '#1D2129',
			},
			data: legendData,
		},
		grid: {
			left: '2%',
			right: '4%',
			bottom: '2%',
			top: '8%',
			containLabel: true,
		},
		tooltip: {
			trigger: 'axis'
		},

		xAxis: {
			type: 'category',
			// x 轴字体样式
			axisLabel: {
				fontSize: 12,
				color: "#86909C;",
			},
			// x轴线 是否显示  x轴改变颜色
			axisLine: {
				show: true,
				lineStyle: {
					color: '#86909C;'
				}
			},
			//x 轴刻度线不显示
			axisTick: {
				show: false
			},
			splitLine: {
				show: false
			},
			data: Xdata
		},
		yAxis: [{
				type: 'value',
				name: ' 万元 ',
				nameTextStyle: {
					color: "#86909C",
					fontSize: 10,
				},
				axisLabel: {
					formatter: "{value}",
				},
				splitLine: {
					show: true,
					lineStyle: {
						color: "#E5E6EB",
						type: "dashed",
					},
				},
			},
			{
				type: 'value',
				name: ' % ',
				axisLabel: {
					formatter: "{value}",
				},
				axisLabel: { //调整左侧Y轴刻度， 直接按对应数据显示
					show: true,
					showMinLabel: true,
					showMaxLabel: true,
					formatter: function (value) {
						return value;
					}
				},
				splitLine: {
					show: true,
					lineStyle: {
						color: "#E5E6EB",
						type: "dashed",
					},
				},
			}
		],

		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div style="width:240px;padding: 8px;
		border-radius: 6px;
		border:1px solid #FFFFFF ;
		box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
		background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
		background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
		background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
								<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}</p>`;
				params.forEach(function (item) {
					result +=
						`
								<div style="display: flex; flex-direction: row;justify-content: space-between;
								background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
									<div style="display: flex; flex-direction: row;align-items: center;">
										${item.marker}
										<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
									</div>
									<div class="">
										<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(item.value)}<span style="font-weight: normal;color: #86909C;font-size: 12px;">`;
					if (item.componentSubType == "line") {
						result += "%";
					} else {
						result += "万元";
					}
					result += `</span></h4>
									</div >
							</div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		series: seriedData,
	}
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}


function dimensionTree(id, allData) {
	// console.log(allData, '传过来的Tree数据')
	let rootName = localStorage.getItem("rootName");
	let chart = echarts.init(document.getElementById(id));

	var getdata = function getData() {
		let data = {
			name: rootName,
			// name: rootName.length > 6 ? rootName.substring(0, 6) + "..." : rootName,
			// nameEllipsis: rootName,
			children: [],
		};
		//来款方式
		let lkxsarr = allData.filter((item) => {
			return item.key02 == '来款方式'
		})
		if (lkxsarr.length > 0) {
			let arr2 = []
			data.children.push({
				name: '来款方式',
				pName: rootName,
				label: {
					// backgroundColor: '#0DCAF0',
					// padding: [10, 15],
					borderRadius: 6,
					fontSize: 20,
					color:'#0DCAF0'
					// color: '#FFFFFF'
				},
				lineStyle: {
					color: '#0DCAF0',
				},
				children: arr2,
			})
			lkxsarr.forEach(v => {
				let child = {};
				child.name = v.key01 ? v.key01 : '暂无名称';
				child.pName = '来款方式',
					child.label = {
						// backgroundColor: '#CFF4FC',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#0DCAF0',
					},
					child.lineStyle = {
						color: '#0DCAF0',
					}
				child.children = [{
					name: "来款金额",
					pName: rootName,
					pName1: '来款方式',
					pName2: v.key01,
					num: v.key03,
					label: {
						// backgroundColor: '#CFF4FC',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#0DCAF0',
					},
					lineStyle: {
						color: '#0DCAF0',
					}

				}]
				arr2.push(child);
			})
		}

		//往来单位
		let wldwarr = allData.filter((item) => {
			return item.key02 == '往来单位'
		})
		if (wldwarr.length > 0) {
			let arr2 = []
			data.children.push({
				name: '往来单位',
				pName: rootName,
				children: arr2,
				label: {
					// backgroundColor: '#F7BA1E',
					// padding: [10, 15],
					borderRadius: 6,
					fontSize: 20,
					color:'#F7BA1E'
					// color: '#FFFFFF'
				},
				lineStyle: {
					color: '#F7BA1E',
				}
			})
			wldwarr.forEach(v => {
				let child = {};
				child.name = v.key01 ? v.key01 : '暂无名称';
				child.pName = '往来单位',
					child.label = {
						// backgroundColor: '#FDF1D2',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#F7BA1E',
					},
					child.lineStyle = {
						color: '#F7BA1E',
					}
				child.children = [{
					name: "来款金额",
					pName: rootName,
					pName1: '往来单位',
					pName2: v.key01,
					num: v.key03,
					label: {
						// backgroundColor: '#FDF1D2',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#F7BA1E',
					},
					lineStyle: {
						color: '#F7BA1E',
					}

				}]
				arr2.push(child);
			})
		}

		//合同
		let htarr = allData.filter((item) => {
			return item.key02 == '合同'
		})
		if (htarr.length > 0) {
			let arr2 = []
			data.children.push({
				name: '合同',
				children: arr2,
				label: {
					// backgroundColor: '#722ED1',
					// padding: [10, 15],
					borderRadius: 6,
					fontSize: 20,
					color:'#722ED1',
					// color: '#FFFFFF'
				},
				lineStyle: {
					color: '#722ED1',
				}
			})
			htarr.forEach(v => {
				let child = {};
				child.name = v.key01 ? v.key01 : '暂无名称';
				child.pName = '合同',
					child.label = {
						// backgroundColor: '#E3D5F6',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#722ED1',
					},
					child.lineStyle = {
						color: '#722ED1',
					}
				child.children = [{
					name: "认领金额",
					pName: rootName,
					pName1: '合同',
					pName2: v.key01,
					num: v.key03,
					label: {
						// backgroundColor: '#E3D5F6',
						padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#722ED1',
					},
					lineStyle: {
						color: '#722ED1',
					}
				}]
				arr2.push(child);
			})
		}
		// 部门
		let bmarr = allData.filter((item) => {
			return item.key02 == '部门'
		})
		if (bmarr.length > 0) {
			let arr2 = []
			data.children.push({
				name: '部门',
				children: arr2,
				label: {
					// backgroundColor: '#165DFF',
					// padding: [10, 15],
					borderRadius: 6,
					fontSize: 20,
					// color: '#FFFFFF'
					color:'#165DFF'
				},
				lineStyle: {
					color: '#165DFF',
				}
			})
			bmarr.forEach(v => {
				let child = {};
				child.name = v.key01 ? v.key01 : '暂无名称';
				child.pName = '部门',
					child.label = {
						// backgroundColor: '#D0DFFF',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#165DFF',
					},
					child.lineStyle = {
						color: '#165DFF',
					}
				child.children = [{
					name: "认领金额",
					pName: rootName,
					pName1: '部门',
					pName2: v.key01,
					num: v.key03,
					label: {
						// backgroundColor: '#D0DFFF',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#165DFF',
					},
					lineStyle: {
						color: '#165DFF',
					}
				}]
				arr2.push(child);
			})
		}
		//任务号
		let rwharr = allData.filter((item) => {
			return item.key02 == '任务号'
		})
		if (rwharr.length > 0) {
			let arr2 = []
			data.children.push({
				name: '任务号',
				children: arr2,
				label: {
					// backgroundColor: '#50CD89',
					// padding: [10, 15],
					borderRadius: 6,
					fontSize: 20,
					// color: '#FFFFFF'
					color:'#50CD89'
				},
				lineStyle: {
					color: '#50CD89',
				}
			})
			rwharr.forEach(v => {
				let child = {};
				child.name = v.key01 ? v.key01 : '暂无名称';
				child.pName = '任务号',
					child.label = {
						// backgroundColor: '#DCF5E7',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#50CD89',
					},
					child.lineStyle = {
						color: '#50CD89',
					}
				child.children = [{
					name: "认领金额",
					pName: rootName,
					pName1: '任务号',
					pName2: v.key01,
					num: v.key03,
					label: {
						// backgroundColor: '#DCF5E7',
						// padding: [10, 15],
						borderRadius: 6,
						fontSize: 14,
						color: '#50CD89',
					},
					lineStyle: {
						color: '#50CD89',
					}
				}]
				arr2.push(child);
			})
		}


		let arr = []
		arr.push(data)
		arr = handle(arr, 0)
		return arr;
	}
	let color = {}
	var handle = function handleData(data, index, color = '#00f6ff') {
		//index标识第几层
		return data.map((item, index2) => {

			return item
		})
	}
	let option = {
		type: "tree",
		title: {
			text: '金额单位:万元',
			right: 10,
			top: 10,
			textStyle: {
				color: '#86909C',
				fontSize: 12
			}
		},

		series: [{
			type: "tree",
			hoverAnimation: true, //hover样式
			zoom: 0.7, //当前视角的缩放比例
			data: getdata(),
			top: 0,
			bottom: 0,
			left: 0,
			right: 0,
			layout: "orthogonal",
			// symbol: "circle",
			// edgeShape: 'polyline',
			symbolSize: 14,
			layerPadding: 10,
			nodePadding: 10,
			animationDurationUpdate: 750,
			expandAndCollapse: true, //子树折叠和展开的交互，默认打开
			initialTreeDepth: 1,
			roam: true, //是否开启鼠标缩放和平移漫游。scale/move/true
			focusNodeAdjacency: true,
			itemStyle: {
				borderWidth: 0,
			},
			label: { //标签样式
				color: "#1D2129",
				fontFamily: "SourceHanSansCN",
				fontWeight: 600,
				position: "left",
				align: 'right',
				lineHeight: 20,
				rotate: 0,
				formatter: function (param) {
					const level = param.treeAncestors.length;
					if (level == 2) {
						return `{root|${param.name}}`
					}
					if (!param.data.num) {
						return `${param.name}`
					} else {
						return `{b|${param.name} : }{a|${param.data.num} 万元} {c|}`
					}
				},
				rich: {
					root: {
						// padding: [10, 20],
						// backgroundColor: '#F7F8FA',
						borderRadius: 4,
						color: "#1D2129",
						fontSize: 20,
						fontWeight: 600,
					},
					a: {
						fontSize: 14,
						fontWeight: 600,
					},
					b: {
						fontSize: 14,
					},
					c: {
						width: 20,
						height: 20,
						backgroundColor: {
							image: 'assets/images/unitdimension/chat-poll-line-bg@2x.png'
						}
					}
				}
			},
			leaves: {
				label: {
				  position: 'right',
				  align: 'left'
				}
			 },

		}]
	}
	chart.setOption(option);

	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
	chart.on('click', treeNodeclick)
}


//预算执行（汇报看板）
function IncomingPaymentCharts(id, xData, legendData, seriesData, legendShow = true, percShow = true) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
		tooltip: {
			trigger: "axis",
			axisPointer: {
				type: "shadow",
				lineStyle: {
					type: "dashed",
					color: "#C9CDD4",
				},
			},
			backgroundColor: "transparent",
			borderWidth: 0,
			padding: 0,
			formatter: function (params) {
				let result = `<div class="chartFormart">
									<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}月</p>`;
				params.forEach(function (item) {
					result += `<div class="chartItemFormart">
										<div style="display: flex; flex-direction: row;align-items: center;">
											${item.marker}
											<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
										</div>
										<div class="">
											<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${figure(
                        item.value
                      )}<span style="font-weight: normal;color: #86909C;font-size: 12px;">`;
					if (item.componentSubType == "line") {
						result += "%";
					} else {
						result += "万元";
					}
					result += `</span></h4>
										</div>
									</div>`;
				});
				result += `</div>`;
				return result;
			},
		},
		grid: {
			left: "0",
			right: "10",
			bottom: "14",
			top: "30",
			containLabel: true,
		},
		legend: {
			data: legendData,
			show: legendShow,
			top: "-3",
			icon: "circle",
			textStyle: {
				color: "#1D2129",
				fontSize: "12",
			},
			itemWidth: 12,
			itemHeight: 12,
		},
		xAxis: [{
			type: "category",
			data: xData,
			splitLine: {
				show: false,
			},
			axisTick: {
				show: false,
			},
			axisLine: {
				show: false,
			},
			axisLabel: {
				fontSize: 12,
				color: "#86909C",
				interval: 0,
			},
		}, ],
		yAxis: [{
				type: "value",
				name: "（万元）",
				nameTextStyle: {
					color: "#86909C",
					fontSize: 10,
				},
				axisLabel: {
					fontSize: 12,
					color: "#86909C",
				},
				splitLine: {
					show: true,
					lineStyle: {
						color: "#E5E6EB",
						type: "dashed",
					},
				},
				axisLine: {
					show: false,
				},
			},
			{
				show: percShow,
				type: "value",
				name: "（%）",
				position: "right",
				alignTicks: true,
				axisLine: {
					lineStyle: {
						fontSize: 12,
						color: "#86909C",
					},
				},
				splitLine: {
					show: true,
					lineStyle: {
						color: "#E5E6EB",
						type: "dashed",
					},
				},
				axisLabel: {
					formatter: "{value}",
				},
			},
		],
		series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
}

function dimensionTree1(id, allData, colors) {
	let chart = echarts.init(document.getElementById(id));
	chart.clear();
	const _data = allData[0];
	var getdata = function getData() {
		let data = {
			name: _data.name,
			nameEllipsis: _data.name,
			value: 0,
			color: '#165DFF',
			children: []
		};
		for (let i = 0; i < _data.children.length; i++) {
			let obj = {
				name: _data.children[i].name,
			};
			if (_data.children[i].children.length > 0) {
				obj.children = []
				for (let j = 0; j < _data.children[i].children.length; j++) {
					let obj2;
					if (_data.children[i].children[j].num) {
						obj2 = {
							name: _data.children[i].children[j].name,
							pname: _data.children[i].name,
							num: _data.children[i].children[j].num,
							moji: _data.children[i].children[j].moji
						};
					} else {
						obj2 = {
							name: _data.children[i].children[j].name,
						};
					}
					if (_data.children[i].children[j].children && _data.children[i].children[j].children.length > 0) {
						obj2.children = []
						for (let k = 0; k < _data.children[i].children[j].children.length; k++) {
							let obj3;
							if (_data.children[i].children[j].children[k].num) {
								obj3 = {
									name: _data.children[i].children[j].children[k].name,
									pname: _data.children[i].children[j].name,
									num: _data.children[i].children[j].children[k].num,
									moji: _data.children[i].children[j].children[k].moji
								};
							} else {
								obj3 = {
									name: _data.children[i].children[j].children[k].name,
								};
							}
							if (_data.children[i].children[j].children[k].children && _data.children[i].children[j]
								.children[k].children.length > 0) {
								obj3.children = [];
								for (let l = 0; l < _data.children[i].children[j].children[k].children
									.length; l++) {
									let obj4 = {
										name: _data.children[i].children[j].children[k].children[l].name,
										pname: _data.children[i].children[j].children[k].name,
										num: _data.children[i].children[j].children[k].children[l].num,
										moji: _data.children[i].children[j].children[k].children[l].moji
									}
									obj3.children.push(obj4);
								}
							}
							obj2.children.push(obj3);
						}
					}
					obj.children.push(obj2);
				}
			}
			data.children.push(obj);
		}
		let arr = []
		arr.push(data)
		arr = handle(arr, 0)
		return arr;
	}
	var handle = function handleData(data, index, color = '#00f6ff') {

		//index标识第几层
		return data.map((item, index2) => {
			//计算出颜色
			if (index == 1) {
				color = colors.find((item, eq) => eq == index2 % 10);
			}
			// 设置label大小
			item.symbolSize = 100
			if (item.children) { //存在子节点
				item.itemStyle = {
					borderColor: '#165DFF',
					color: '#FFFFFF'
				};
				item.children = handle(item.children, index + 1, color)
			} else { //不存在
				item.itemStyle = {
					color: '#FFFFFF',
					borderColor: 'transparent'
				};

			}
			// 设置节点大小

			if (index === 0) {
				item.itemStyle = {
					borderColor: '#165DFF',
					color: '#165DFF'
				};
				item.label = {
					color: "#ffffff"
				}
			}
			return item
		})
	}
	let option = {
		type: "tree",
		title: {
			text: '金额单位:万元',
			right: 10,
			top: 10,
			textStyle: {
				color: '#86909C',
				fontSize: 12
			}
		},
		tooltip: { //提示框
			trigger: "item",
			triggerOn: "mousemove",
			backgroundColor: "rgba(1,70,86,1)",
			borderColor: "rgba(0,246,255,1)",
			borderWidth: 0.5,
			textStyle: {
				fontSize: 10
			},
			formatter: function (params) {
				// console.log(params)
			}
		},
		series: [{
			type: "tree",
			hoverAnimation: true, //hover样式
			data: getdata(),
			top: 0,
			bottom: 0,
			left: 0,
			right: 0,
			layout: "radial",
			symbol: "circle",
			symbolSize: 10,
			nodePadding: 20,
			animationDurationUpdate: 750,
			expandAndCollapse: true, //子树折叠和展开的交互，默认打开
			initialTreeDepth: 2,
			roam: true, //是否开启鼠标缩放和平移漫游。scale/move/true
			focusNodeAdjacency: true,
			itemStyle: {
				borderWidth: 1,
			},
			label: { //标签样式
				color: "#1D2129",
				fontFamily: "SourceHanSansCN",
				fontWeight: 600,
				position: "inside",
				align: 'center',
				lineHeight: 20,
				rotate: 0,
				formatter: function (param) {
					if (!param.data.num) {
						return [`{a|${param.name}}`].join('\n')
					} else {
						return [`{b|${param.name}}`, `{a|${param.data.num}}`,
							`{c|}`
						].join('\n')
					}
				},
				rich: {
					a: {
						fontSize: 16,
					},
					b: {
						fontSize: 14,
						color: '#4E5969',
					},
					c: {
						backgroundColor: {
							image: 'assets/images/unitdimension/chat-poll-line1.svg'
						}
					}
				}
			},

			lineStyle: {
				width: 2,
				curveness: 0.5,
				color: '#C9CDD4'
			}
		}]
	}
	chart.setOption(option);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
	chart.on('click', treeNodeclick)
}


function dimensionRelation(id, allData) {
	let chart = echarts.init(document.getElementById(id));
	chart.clear();
	const _data = allData[0];
	const colors = [
		"#165DFF",
		"#722ED1",
		"#50CD89",
		'#F7BA1E',
		'#0DCAF0',
		'#F99057'
	];
	const colorSec = [
		'#D0DFFF',
		'#E3D5F6',
		'#DCF5E7',
		'#FDF1D2',
		'#CFF4FC',
		'#FEE9DD'
	]
	const colorTxt = [
		'#0B2E80',
		'#391769',
		'#286745',
		'#7C5D0F',
		'#066578',
		'#7D482B'
	]
	var getdata = function getData() {
		let data = {
			name: _data.name,
			nameEllipsis: _data.name,
			value: 0,
			color: '#165DFF',
			children: []
		};
		for (let i = 0; i < _data.children.length; i++) {
			let obj = {
				name: _data.children[i].name,
			};
			console.log(_data.children[i].name,_data.children[i].children)
			if (_data.children[i].children&&_data.children[i].children.length > 0) {
				obj.children = []
				for (let j = 0; j < _data.children[i].children.length; j++) {
					let obj2;
					if (_data.children[i].children[j].num) {
						obj2 = {
							name: _data.children[i].children[j].name,
							pname: _data.children[i].name,
							num: _data.children[i].children[j].num,
							pindex: i,
							course: _data.children[i].children[j].course
						};
					} else {
						obj2 = {
							name: _data.children[i].children[j].name,
							pindex: i
						};
					}
					if (_data.children[i].children[j].children && _data.children[i].children[j].children.length > 0) {
						obj2.children = []
						for (let k = 0; k < _data.children[i].children[j].children.length; k++) {
							let obj3;
							if (_data.children[i].children[j].children[k].num) {
								obj3 = {
									name: _data.children[i].children[j].children[k].name,
									pname: _data.children[i].children[j].name,
									num: _data.children[i].children[j].children[k].num,
									pindex: i,
									course: _data.children[i].children[j].children[k].course
								};
							} else {
								obj3 = {
									name: _data.children[i].children[j].children[k].name,
									pindex: i
								};
							}
							if (_data.children[i].children[j].children[k].children && _data.children[i].children[j]
								.children[k].children.length > 0) {
								obj3.children = [];
								for (let l = 0; l < _data.children[i].children[j].children[k].children
									.length; l++) {
									let obj4 = {
										name: _data.children[i].children[j].children[k].children[l].name,
										pname: _data.children[i].children[j].children[k].name,
										num: _data.children[i].children[j].children[k].children[l].num,
										pindex: i,
										course: _data.children[i].children[j].children[k].children[l].course
									}
									obj3.children.push(obj4);
								}
							}
							obj2.children.push(obj3);
						}
					}
					obj.children.push(obj2);
				}
			}
			data.children.push(obj);
		}
		let arr = []
		arr.push(data)
		arr = handle(arr, 0)
		return arr
	}

	var handle = function handleData(data, index, color = '#F7F8FA') {
		//index标识第几层
		return data.map((item, index2) => {
			//计算出颜色
			if (index == 1) {
				color = colors.find((item, eq) => eq == index2 % 6);
			}
			if (index >= 2) {
				color = colorSec[item.pindex % 6];
			}
			// 设置线条颜色
			item.lineStyle = {
				color: color
			}
			if (index == 0) {
				item.lineStyle = {
					color: '#C9CDD4'
				}
			}
			// 设置label大小
			if (item.children) { //存在子节点
				item.children = handle(item.children, index + 1, color)
			}
			if (index === 0) {
				item.itemStyle = {
					// color: '#F7F8FA'
				};
				item.label = {
					color: "#1D2129",
					fontSize: 20,
					backgroundColor: color,
					fontWeight: 600,
				}
			}
			if (index === 1) {
				item.label = {
					// color: "#FFFFFF",
					color:color,
					fontSize: 20,
					// backgroundColor: color,
					fontWeight: 600,
				}
			}
			if (index >= 2) {
				item.label = {
					color: colorTxt[item.pindex % 6],
					// padding: [5, 10],
					fontSize: 14,
					// backgroundColor: color,
					fontWeight: 'normal'
				}
			}

			return item
		})
	}
	let option = {
		// tooltip: { trigger: 'item', triggerOn: 'mousemove' },
		series: [{
			color: colors,
			type: 'tree',
			left: 100,
			right: 150,
			// 开启缩放和平移
			roam: true,
			// 树图布局
			layout: 'orthogonal',
			nodePadding: 20,
			// 从右到左 LR, RL, TB, BT
			orient: 'LR',
			// 定义图片
			// symbol: 'circle',
			// edgeShape: 'polyline',
			symbolSize: 14,
			// symbolOffset: [0,-30],
			// 展开的节点 -1，null 或者 undefined 表示所有节点都展开
			initialTreeDepth: 1,
			// 开启折叠节点
			expandAndCollapse: true,
			focusNodeAdjacency: true,

			label: { //标签样式
				color: "#1D2129",
				fontFamily: "SourceHanSansCN",
				fontWeight: 600,
				position: "left",
				align: 'right',
				lineHeight: 20,
				borderRadius: 6,
				// padding: [10, 20],
				rotate: 0,
				formatter: function (param) {
					if (!param.data.num) {
						return [`{a|${param.name}}`].join('\n')
					} else {
						return [`{b|${param.name}：}{d|${param.data.num}万元} {c|}`].join('\n')
					}
				},
				rich: {
					d: {
						fontWeight: 600,
					},
					b: {
						fontSize: 14,
					},
					c: {
						backgroundColor: {
							image: 'assets/images/unitdimension/chat-poll-line2.svg'
						},
						fontSize: 18,
					}
				}
			},
			leaves: {
				label: {
				  position: 'right',
				  align: 'left'
				}
			 },
			lineStyle: {
				// 连接线的弧度
				curveness: 0.5,
				// 线的粗细
				width: 1,
			},
			// tooltip: {
			//     formatter: params => { return params.value.replace('/r/n','<br/>')}
			// },
			data: getdata()
		}]
	}
	chart.setOption(option, true);
	window.addEventListener("resize", function () {
		chart.resize();
	});
	$("div").resize(function () {
		chart.resize();
	});
	treeNodeclick&&chart.on('click', treeNodeclick)
}



//任务号-应收金额/到款金额
function BMHT(id, seriesData, legendData , yData){
	let chart = echarts.init(document.getElementById(id));
	let option = {
			backgroundColor: "#fff",
			// title: {
			//     text: "个",
			//     left: "18px",
			//     top: "2",
			//     textStyle: {
			//         color: "#86909C",
			//         fontSize: 10,
			//         fontWeight: "400",
			//     },
			// },
			color: [ "#14C9C9", "#F7BA1E","#165DFF"],
			tooltip: {
					trigger: "axis",
					axisPointer: {
							lineStyle: {
									type: "dashed",
									color: "#C9CDD4",
							},
					},
					backgroundColor: "transparent",
					borderWidth: 0,
					padding: 0,
					position: function (point, params, dom, rect, size) { // 提示框位置
							let x = 0;
							let y = 0;
							//固定在中间
							if (point[0] + size.contentSize[0] > size.viewSize[0]) {
								 x = point[0] - size.contentSize[0]
							} else {
								 x = point[0]
							}
							if (point[1] > size.contentSize[1]) {
								 y = point[1] - size.contentSize[1]
							} else if (point[1] + size.contentSize[1] < size.viewSize[1]) {
								 y = point[1]
							} else {
								 y = "60%"
							}
							return [x, y];
					 },
					formatter: function(params) {
							let result = `
							<div style="width:250px;padding: 8px;border-radius: 6px;border:1px solid #FFFFFF ;box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83)background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
						<p style="color: #1D2129;font-size: 12px;font-weight: 600; margin:0">${params[0].name}</p>`;
							params.forEach(function(item) {
									result += `
						<div style="display: flex; flex-direction: row;justify-content: space-between;
						background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
							<div style="display: flex; flex-direction: row;align-items: center;">
								${item.marker}
								<p style="color: #4E5969;font-size: 12px; margin:0">${item.seriesName}</p>
							</div>
							<div class="">
								<h4 style="color: #1D2129;font-size: 14px;font-weight: 600; margin:0">${figure(item.value)}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
							</div>
						</div>
					`;
							});
							result += `</div>`;
							return result;
					},
			},
			grid: {
					left: "0",
					right: "50",
					bottom: "14",
					top: "40",
					containLabel: true,
			},
			legend: {
					data: legendData,
					show: true,
					left: "30",
					top: "10",
					icon: "rect",
					textStyle: {
							color: "#1D2129",
							fontSize: "12",
					},
					itemWidth: 12,
					itemHeight: 12,
			},
			xAxis: {
					type: "value",
					// x轴线 是否显示  x轴改变颜色
					name: "万元",
					nameTextStyle: {
							color: "#86909C",
							fontSize: 12,
					},
					splitLine: {
							lineStyle: {
									color: '#F2F2F5',
									type:'dashed',
							}
					},
					axisTick: {
							show: false,
					},
					axisLine: {
							lineStyle: {
									color: "#C1CBE5",
							},
					},
					axisLabel: {
			 show: true,
			 textStyle: {
					color: "#727781",
					fontSize: 12,
			 },
		},
			},
			yAxis: {
					type: 'category',
					data: yData ,
					
					axisLine: {
							show: true,
							lineStyle: {
									color: '#E4E6E9'
							}
					},
					axisLabel: {
							fontSize: 12,
							color: "#86909C",
					},
					
					splitLine:{
							show:false
					}, //去除网格线
					axisTick: {
							show: false
					} // 取消坐标轴刻度线
			},
			series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function() {
			chart.resize();
	});
	$("div").resize(function() {
			chart.resize();
	});
}
function bmReceived(id, seriesData, legendData, xData, xDanwei, rotate,titleText) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
			legend: {
					data: legendData,
					show: true,
					right: "0",
					top: "0",
					icon: "rect",
					textStyle: {
							color: "#1D2129",
							fontSize: "12",
					},
					itemWidth: 8,
					itemHeight: 8,
			},
			xAxis: {
					name: xDanwei ? xDanwei : "年",
					nameTextStyle: {
							color: "#86909C",
							fontSize: 10,
					},
					type: "category",
					data: xData ? xData :  ' ',
					splitLine: {
							show: false,
					},
					axisTick: {
							show: false,
					},
					axisLine: {
							show: true,
							lineStyle:{
									color:'#E4E6E9'
							}
					},
					axisLabel: {
							rotate: rotate > 0 ? rotate : 0,
							fontSize: 12,
							color: "#86909C",
					},
			},
			backgroundColor: "#fff",
			title: {
					text: titleText ? titleText : "个",
					left: "18px",
					top: "15",
					textStyle: {
							color: "#86909C",
							fontSize: 12,
							fontWeight: "400",
					},
			},
			tooltip: {
					trigger: "axis",
					axisPointer: {
							type: "shadow",
							lineStyle: {
									type: "dashed",
									color: "#C9CDD4",
							},
					},
					backgroundColor: "transparent",
					borderWidth: 0,
					padding: 0,
					formatter: function(params) {
							let result = `<div style="width:240px;padding: 8px;
	border-radius: 6px;
	border:1px solid #FFFFFF ;
	position: relative;
	z-index: 9999;
	box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
	background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
	background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
							<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}${ xDanwei ? xDanwei : '年'}</p>`;
							params.forEach(function(item) {
									result += `
							<div style="display: flex; flex-direction: row;justify-content: space-between;
							background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
								<div style="display: flex; flex-direction: row;align-items: center;">
									${item.marker}
									<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
								</div>
								<div class="">
									<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">${titleText}</span></h4>
								</div>
							</div>
						`;
							});
							result += `</div>`;
							return result;
					},
			},
			grid: {
					left: "0",
					right: "5",
					bottom: "14",
					top: "50",
					containLabel: true,
			},
			yAxis: {
					type: "value",
					// max: '100',
					axisLabel: {
							fontSize: 12,
							color: "#86909C",
					},
					splitLine: {
							show: true,
							lineStyle: {
									color: "#E5E6EB",
									type: "dashed",
							},
					},
					axisLine: {
							show: false,
					},
			},
			series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function() {
			chart.resize();
	});
	$("div").resize(function() {
			chart.resize();
	});
}
function CBZEYD(id, seriesData, legendData, xData, xDanwei, rotate) {
	let chart = echarts.init(document.getElementById(id));
	let option = {
			legend: {
					data: legendData,
					show: true,
					right: "0",
					top: "0",
					icon: "rect",
					textStyle: {
							color: "#1D2129",
							fontSize: "12",
					},
					itemWidth: 8,
					itemHeight: 8,
			},
			xAxis: {
					name: xDanwei ? xDanwei : "月",
					nameTextStyle: {
							color: "#86909C",
							fontSize: 10,
					},
					type: "category",
					data: xData ? xData : ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
					splitLine: {
							show: false,
					},
					axisTick: {
							show: false,
					},
					axisLine: {
							show: true,
							lineStyle:{
									color:'#E4E6E9'
							}
					},
					axisLabel: {
							rotate: rotate > 0 ? rotate : 0,
							fontSize: 12,
							color: "#86909C",
					},
			},
			backgroundColor: "#fff",
			title: {
					text: "万元",
					left: "18px",
					top: "15",
					textStyle: {
							color: "#86909C",
							fontSize: 10,
							fontWeight: "400",
					},
			},
			tooltip: {
					trigger: "axis",
					axisPointer: {
							type: "shadow",
							lineStyle: {
									type: "dashed",
									color: "#C9CDD4",
							},
					},
					backgroundColor: "transparent",
					borderWidth: 0,
					padding: 0,
					formatter: function(params) {
							let result = `<div style="width:240px;padding: 8px;
	border-radius: 6px;
	border:1px solid #FFFFFF ;
	position: relative;
	z-index: 9999;
	box-shadow: 0 2px 5px 1px rgba(199, 211, 233, 0.83);
	background: -moz-linear-gradient(top, #F4F7FC 0%, #ffffff 100%);
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F4F7FC), color-stop(100%,#ffffff));
	background: -webkit-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -o-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: -ms-linear-gradient(top, #F4F7FC 0%,#ffffff 100%);
	background: linear-gradient(to bottom, #F4F7FC 0%,#ffffff 100%);">
							<p style="color: #1D2129;font-size: 12px;font-weight: 600;">${params[0].name}${xDanwei?  xDanwei : '月'}</p>`;
							params.forEach(function(item) {
									result += `
							<div style="display: flex; flex-direction: row;justify-content: space-between;
							background: #FFFFFF;border-radius: 4px;box-shadow: 6px 0 20px 1px rgba(34, 87, 188, 0.1);padding:6px 8px; margin-top: 4px;" >
								<div style="display: flex; flex-direction: row;align-items: center;">
									${item.marker}
									<p style="color: #4E5969;font-size: 12px;">${item.seriesName}</p>
								</div>
								<div class="">
									<h4 style="color: #1D2129;font-size: 14px;font-weight: 600;">${item.value}<span style="font-weight: normal;color: #86909C;font-size: 12px;">万元</span></h4>
								</div>
							</div>
						`;
							});
							result += `</div>`;
							return result;
					},
			},
			grid: {
					left: "0",
					right: "5",
					bottom: "14",
					top: "50",
					containLabel: true,
			},
			yAxis: {
					type: "value",
					// max: '100',
					axisLabel: {
							fontSize: 12,
							color: "#86909C",
					},
					splitLine: {
							show: true,
							lineStyle: {
									color: "#E5E6EB",
									type: "dashed",
							},
					},
					axisLine: {
							show: false,
					},
			},
			series: seriesData,
	};
	chart.setOption(option);
	window.addEventListener("resize", function() {
			chart.resize();
	});
	$("div").resize(function() {
			chart.resize();
	});
}


